set more off
clear
use Post-Sechser-ISQ2023.dta


********** TABLE 1: Military Hand-tying ********** 

* Logit models
eststo M1: logit success i.military_signal, robust cluster(dyad)
eststo M3: logit success i.military_signal i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M2: logit success i.showofforce i.mobilization, robust cluster(dyad)
eststo M4: logit success i.showofforce i.mobilization i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
esttab M1 M2 M3 M4, se(3) pr2 b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

* Marginal effects reported in main text
logit success i.military_signal, robust cluster(dyad)
margins military_signal
logit success i.showofforce i.mobilization i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
margins mobilization, at(showofforce = 0 territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1) atmeans
margins showofforce, at(mobilization = 0 territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1) atmeans
lincom 1.mobilization - 1.showofforce


********** FIGURE 1: Marginal Effect of Military Signals ********** 

* Ordered logit models
eststo M1o: ologit success3 i.military_signal, robust cluster(dyad)
eststo M2o: ologit success3 i.showofforce i.mobilization, robust cluster(dyad)
eststo M3o: ologit success3 i.military_signal i.military_signal i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M4o: ologit success3 i.showofforce i.mobilization i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
esttab M1o M2o M3o M4o, se(3) pr2 b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

* Estimate marginal effects
est restore M3
eststo marginsM1: margins, dydx(military_signal) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1) atmeans post
est restore M3o
eststo marginsM1o: margins, predict(outcome(2)) dydx(military_signal) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1) atmeans post
est restore M4
eststo marginsM2a: margins, dydx(showofforce) at(mobilization = 0 territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1) atmeans post
est restore M4o
eststo marginsM2ao: margins, predict(outcome(2)) dydx(showofforce) at(mobilization = 0 territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1) atmeans post
est restore M4
eststo marginsM2b: margins, dydx(mobilization) at(showofforce = 0 territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1) atmeans post
est restore M4o
eststo marginsM2bo: margins, predict(outcome(2)) dydx(mobilization) at(showofforce = 0 territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1) atmeans post

* Create figure
set scheme s1mono
coefplot (marginsM1 \ marginsM2a \ marginsM2b, label(Binary Logit) offset(.1) msymbol(circle) mcolor(black) ciopts(color(black) recast(rcap))) (marginsM1o \ marginsM2ao \ marginsM2bo, label(Ordered Logit) offset(-.1) msymbol(circle) mcolor(gs10) ciopts(color(gs10) recast(rcap))), xlabels(-1 -.5 "-0.5" 0 .5 "0.5" 1) ytitle("") title("") xtitle("Marginal Effect of Military Signals") horiz xline(0) yscale(reverse) xline(0) drop(territory reparations leadership policy contig_ks capshare_a_ks _cons) coeflabel(1.military_signal = "Any Military Signal" 1.showofforce = "Shows of Force" 1.mobilization = "Mobilizations") legend(off) grid(none) aspectratio(1)
*graph export "Marginal Effect of Military Signals.eps", replace


********** TABLE 2: Domestic Hand-tying ********** 

* Logit models
eststo M7: logit success i.military_signal##democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M9: logit success i.military_signal##democadv i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M11: logit success i.military_signal##nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M8: logit success i.showofforce##democpolity_a i.mobilization##democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M10: logit success i.showofforce##democadv i.mobilization##democadv i.democpolity_a i.democpolity_b theta2_mean   c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M12: logit success i.showofforce##nonpersonalist_a_tss i.mobilization##nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
esttab M7 M9 M11 M8 M10 M12, se(3) pr2 b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)


********** FIGURE 2: Marginal Effect of Regime Type ********** 

* Ordered logit models
eststo M7o: ologit success3 i.military_signal##democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M8o: ologit success3 i.showofforce##democpolity_a i.mobilization##democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M9o: ologit success3 i.military_signal##democadv i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M10o: ologit success3 i.showofforce##democadv i.mobilization##democadv i.democpolity_a i.democpolity_b theta2_mean   c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M11o: ologit success3 i.military_signal##nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M12o: ologit success3 i.showofforce##nonpersonalist_a_tss i.mobilization##nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
esttab M7o M8o M9o M10o M11o M12o, se(3) pr2 b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

* Estimate marginal effects
est restore M7
eststo marginsM7: margins, dydx(democpolity_a) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 military_signal = 1) atmeans post
est restore M9
eststo marginsM9: margins, dydx(democadv) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 military_signal = 1) atmeans post
est restore M11
eststo marginsM11: margins, dydx(nonpersonalist_a_tss) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 military_signal = 1) atmeans post


est restore M7o
eststo marginsM7o: margins, predict(outcome(2)) dydx(democpolity_a) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 military_signal = 1) atmeans post
est restore M9o
eststo marginsM9o: margins, predict(outcome(2)) dydx(democadv) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 military_signal = 1) atmeans post
est restore M11o
eststo marginsM11o: margins, predict(outcome(2)) dydx(nonpersonalist_a_tss) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 military_signal = 1) atmeans post


est restore M8
eststo marginsM8a: margins, dydx(democpolity_a) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 1 mobilization = 0) atmeans post
est restore M10
eststo marginsM10a: margins, dydx(democadv) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 1 mobilization = 0) atmeans post
est restore M12
eststo marginsM12a: margins, dydx(nonpersonalist_a_tss) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 1 mobilization = 0) atmeans post

est restore M8o
eststo marginsM8ao: margins, predict(outcome(2)) dydx(democpolity_a) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 1 mobilization = 0) atmeans post
est restore M10o
eststo marginsM10ao: margins, predict(outcome(2)) dydx(democadv) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 1 mobilization = 0) atmeans post
est restore M12o
eststo marginsM12ao: margins, predict(outcome(2)) dydx(nonpersonalist_a_tss) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 1 mobilization = 0) atmeans post


est restore M8
eststo marginsM8b: margins, dydx(democpolity_a) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 0 mobilization = 1) atmeans post
est restore M10
eststo marginsM10b: margins, dydx(democadv) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 0 mobilization = 1) atmeans post
est restore M12
eststo marginsM12b: margins, dydx(nonpersonalist_a_tss) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 0 mobilization = 1) atmeans post


est restore M8o
eststo marginsM8bo: margins, predict(outcome(2)) dydx(democpolity_a) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 0 mobilization = 1) atmeans post
est restore M10o
eststo marginsM10bo: margins, predict(outcome(2)) dydx(democadv) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 0 mobilization = 1) atmeans post
est restore M12o
eststo marginsM12bo: margins, predict(outcome(2)) dydx(nonpersonalist_a_tss) at(territory = 1 reparations = 0 leadership = 0 policy = 0 contig_ks = 1 democpolity_b = 1 showofforce = 0 mobilization = 1) atmeans post

* Create figure
set scheme s1mono
coefplot (marginsM7 \ marginsM9 \ marginsM11, label(Binary) offset(.1) mcolor(black) ciopts(color(black) recast(rcap) msize(small))) (marginsM7o \ marginsM9o \ marginsM11o,label(Ordered) offset(-.1) mcolor(gs10) ciopts(color(gs10) recast(rcap) msize(small))), bylabel(Military Signals) || (marginsM8a \ marginsM10a \ marginsM12a, offset(.1) mcolor(blue) ciopts(color(blue) recast(rcap) msize(small))) (marginsM8ao \ marginsM10ao \ marginsM12ao, offset(-.1) mcolor(gs10) ciopts(color(gs10) recast(rcap) msize(small))), bylabel(Shows of Force) || (marginsM8b \ marginsM10b \ marginsM12b, offset(.1) mcolor(black) ciopts(color(black) recast(rcap) msize(small))) (marginsM8bo \ marginsM10bo \ marginsM12bo, offset(-.1) mcolor(gs10) ciopts(color(gs10) recast(rcap) msize(small))), bylabel(Mobilizations) ||, legend(off) xlabels(-1 -.5 "-0.5" 0 .5 "0.5" 1) ytitle("") title("") xtitle("Marginal Effect of Regime Type") horiz xline(0) coeflabel(1.democpolity_a = "Democracy" 1.democadv = "Democratic Advantage" 1.nonpersonalist_a_tss = "Non-Personalist") grid(none) byopts(xrescale row(1) legend(off)) aspectratio(1) msize(vsmall) msymbol(circle) 
*graph export "Marginal Effect of Regime Type - All Models.eps", replace



**** Appendix B: Robustness checks ********** 

* Table SI-1
eststo M1o: ologit success3 i.military_signal, robust cluster(dyad)
eststo M2o: ologit success3 i.showofforce i.mobilization, robust cluster(dyad)
eststo M3o: ologit success3 i.military_signal i.military_signal i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M4o: ologit success3 i.showofforce i.mobilization i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)


* Table SI-2
eststo M7o: ologit success3 i.military_signal##democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M8o: ologit success3 i.showofforce##democpolity_a i.mobilization##democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M9o: ologit success3 i.military_signal##democadv i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M10o: ologit success3 i.showofforce##democadv i.mobilization##democadv i.democpolity_a i.democpolity_b theta2_mean   c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M11o: ologit success3 i.military_signal##nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M12o: ologit success3 i.showofforce##nonpersonalist_a_tss i.mobilization##nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
esttab M7o M9o M11o , se(3) pr2 b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)


* Table SI-3
eststo M1f: logit success_force i.military_signal, robust cluster(dyad)
eststo M3f: logit success_force i.military_signal i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M2f: logit success_force i.showofforce i.mobilization, robust cluster(dyad)
eststo M4f: logit success_force i.showofforce i.mobilization i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
esttab M1f M3f M2f M4f, se(3) pr2 b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)


* Table SI-4
eststo M7f: logit success_force i.military_signal##democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M9f: logit success_force i.military_signal##democadv i.democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M11f: logit success_force i.military_signal##nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M8f: logit success_force i.showofforce##democpolity_a i.mobilization##democpolity_a i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M10f: logit success_force i.showofforce##democadv i.mobilization##democadv i.democpolity_a i.democpolity_b theta2_mean   c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M12f: logit success_force i.showofforce##nonpersonalist_a_tss i.mobilization##nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
esttab M7f M9f M11f M8f M10f M12f, se(3) pr2 b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)


*Table SI-5
eststo M1A: logit success i.military_signal theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M2A: logit success i.showofforce i.mobilization theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M3A: logit success i.military_signal i.democpolity_a i.democpolity_b democadv theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M4A: logit success i.showofforce i.mobilization i.democpolity_a i.democpolity_b democadv theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M5A: logit success i.military_signal i.nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
eststo M6A: logit success i.showofforce i.mobilization i.nonpersonalist_a_tss i.democpolity_b theta2_mean c.capshare_a_ks i.territory i.reparations i.leadership i.policy i.contig_ks, robust cluster(dyad)
esttab M1A M2A M3A M4A M5A M6A, se(3) pr2 b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

